package com.lottery.im.widget.dialog;

import android.app.Activity;

/**
 * Created by lianwufeng on 2017/10/13.
 */

public class LoadingDialogUtil {

  private static LoadingDialog loadingDialog;

  /*
   *  显示加载对话框
   * */
  public static void showProgressDialog(Activity activity) {
    if (null == loadingDialog || !loadingDialog.isShowing()) {
      loadingDialog = new LoadingDialog.Builder(activity).create();
      loadingDialog.show();
    }
  }

  /**
   * 取消加载对话框
   */
  public static void cancelProgressDialog() {
    if (null != loadingDialog && loadingDialog.isShowing()) {
      loadingDialog.cancel();
    }
    loadingDialog = null;
  }
}
